<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<?php $this->load->view('common/head');?>

<?php $this->load->view('common/header');?>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <?php $this->load->view('common/sidebar');?>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <?php $this->load->view('common/breadcrumbs');?>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">

                <?php $this->load->view('common/set');?>

                <!-- /section:settings.box -->
                <div class="row">
							<div class="col-xs-12">
								<form accept-charset="UTF-8" id="form" action="<?php echo site_url(X_URL.'categorys/add');?>" class="form-horizontal" role="form" method="post" novalidate="novalidate">
								<?php echo csrf_hidden();?>
									<div class="space-4"></div>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="web_category"> 分类名称 </label>

										<div class="col-sm-9">
											<input type="text"  name="category_name" placeholder="分类名称" class="col-xs-10 col-sm-5" value="" id="category_name">
											
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="web_category"> 送货费税点 </label>
										<div class="col-sm-9">
											<input type="text"  name="category_tax" placeholder="送货费税点" class="col-xs-10 col-sm-5" value="">
											
										</div>
									</div>	
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label no-padding-right" for="web_category"> 排序 </label>

                                        <div class="col-sm-9">
                                            <input type="text"  name="order" placeholder="排序" class="col-xs-10 col-sm-5" value="">
                                            
                                        </div>
                                    </div>
                                   <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 在官网推荐显示 </label>
                                <div class="control-label no-padding-left col-sm-1">
                                    <label>
                                        <input name="all_category" id="all_category"
                                        class="ace ace-switch ace-switch-2" type="checkbox" value="1" />
                                        <span class="lbl"></span>
                                    </label>
                                </div>
                                <span class="help-inline col-xs-12 col-sm-7">
                                                <span class="middle">YES，显示；NO，不显示</span>
                                        </span>
                            </div>
									<div class="col-md-offset-2 col-md-9">
                                <button class="btn btn-info" type="submit">
                                    <i class="icon-ok bigger-110"></i>
                                    提交
                                </button>

                                &nbsp; &nbsp; &nbsp;
                                <button class="btn" type="reset">
                                    <i class="icon-undo bigger-110"></i>
                                    重置
                                </button>
                            </div>
								</form>
							
						</div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->

<?php $this->load->view('common/footer');?>
</div><!-- /.main-container -->

<?php $this->load->view('common/footerjs');?>
<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(function () {

        $("#officialnews ul").html('<div class="ace-icon fa fa-spinner fa-spin orange"></div>');

    })

    $(function () {
        $(".btn-info").click(function () {
        	// var pid = $("#pid").val();
            var category_name = $("#category_name").val();
            var all_category = $("#all_category").val();
            // if (pid == 0) {
            //     bootbox.dialog({
            //         title: "系统提示",
            //         message: "抱歉，分类类型必须选择。",
            //         buttons: {
            //             "success": {
            //                 "label": "确定",
            //                 "className": "btn-danger"
            //             }
            //         }
            //     });
            //     return false;
            // }
            if (category_name == '') {
                bootbox.dialog({
                    message: "抱歉，分类名称不能为空。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return false;
            }
            
            if (all_category == '') {
                bootbox.dialog({
                    message: "总分类不能为空",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return false;
            }
            $("#form").submit();

        })
    })

</script>
</body>
</html>
